package com.fxp.project.jiuselu.web.models.shareprofit.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 分润记录表
 * </p>
 *
 * @author M_
 * @since 2021-12-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class JslShareProfitRecord implements Serializable {


    /**
     * 主键
     */
    @TableId(value = "record_id", type = IdType.AUTO)
    private Long recordId;

    /**
     * 订单号
     */
    @TableField("order_id")
    private String orderId;

    /**
     * 创建时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 分润金额
     */
    @TableField("profit_money")
    private BigDecimal profitMoney;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 创建订单者的用户id
     */
    @TableField("create_user")
    private Long createUser;

    /**
     *  代理登记 1.客户产生2.一级代理产生3.二级代理产生
     */
    @TableField("level")
    private Integer level;

    /**
     *  一级代理产生
     */
    @TableField("two_create")
    private Long twoCreate;

    /**
     *  二级代理产生
     */
    @TableField("thr_create")
    private Long thrCreate;



    @TableField(exist = false)
    private String name;

    @TableField(exist = false)
    private Long state;

    public JslShareProfitRecord() {

    }

    public JslShareProfitRecord(String orderId, BigDecimal profitMoney, Long userId,Long createUser,Integer level) {
        this.orderId = orderId;
        this.profitMoney = profitMoney;
        this.userId = userId;
        this.createTime=LocalDateTime.now();
        this.createUser=createUser;
        this.level=level;
    }

    public JslShareProfitRecord(String orderId, BigDecimal profitMoney, Long userId,Long createUser,Integer level,Long twoCreate) {
        this.orderId = orderId;
        this.profitMoney = profitMoney;
        this.userId = userId;
        this.createTime=LocalDateTime.now();
        this.createUser=createUser;
        this.level=level;
        this.twoCreate=twoCreate;
    }

    public JslShareProfitRecord(String orderId, BigDecimal profitMoney, Long userId,Long createUser,Integer level,Long twoCreate,Long thrCreate) {
        this.orderId = orderId;
        this.profitMoney = profitMoney;
        this.userId = userId;
        this.createTime=LocalDateTime.now();
        this.createUser=createUser;
        this.level=level;
        this.twoCreate=twoCreate;
        this.thrCreate = thrCreate;
    }


}
